package org.example.dev.learn.testdecorator;

public class Decorator implements Component{

    private Component component;

    /**
     * 通过构造函数传递被修饰者,依赖注入
     * @param component
     */
    public Decorator(Component component) {
        this.component = component;
    }

    /**
     * 委托给被修饰者执行
     */
    public void operate() {
        this.component.operate();
    }

}
